﻿@model EyeOpen.Mvc.Models.ContentLocalizedViewModel
@{
	Layout = "~/Views/Shared/_Private.cshtml";
}

<script src="../../Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@Html.ValidationSummary(true, "Fix the errors to save the content.")

@using (Html.BeginForm("Save", "BackEnd")) {
	<div>
		<fieldset>
			<legend>Content editing</legend>

			@if (Model.Saved) 
			{
				<script type="text/javascript">
					$(document).ready(function () {
						$("#contentSaved").css("display", "none");

						$("#contentSaved").fadeIn(2000);

						$("#contentSaved").fadeOut(2000);

					});				
				</script>
				<div 
					id="contentSaved" 
					style="padding: 2 5 2 5; background-color: #efefef;border:1px solid #ababab; width: 150px; text-align: center; margin-top:10px;">Content saved</div> 
			}
			
			@Html.HiddenFor(m => m.Id)

			<div class="editor-label">
				@Html.LabelFor(m => m.Title)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(m => m.Title)
				@Html.ValidationMessageFor(m => m.Title)
			</div>

			<div class="editor-label">
				@Html.LabelFor(m => m.Description)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(m => m.Description)
				@Html.ValidationMessageFor(m => m.Description)
			</div>

			<div class="editor-label">
				@Html.LabelFor(m => m.Keywords)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(m => m.Keywords)
				@Html.ValidationMessageFor(m => m.Keywords)
			</div>

			<div class="editor-label">
				@Html.LabelFor(m => m.Body)
			</div>
			<div class="editor-label">
				@Html.TextAreaFor(m => m.Body)
				@Html.ValidationMessageFor(m => m.Body)
			</div>

			<p>
				<input type="submit" value="Save" />
			</p>

			@Html.ActionLink("Back", "Index", "BackEnd")
		</fieldset>
	</div>
}